

	<div id="photo_upload">
		
	</div>

	<div id="photo_url">
		<label for="description">Photo URL</label>
		<input class="input-text" type="text" name="url" id="url" size="80" value="{editUrl}" />
	</div>

	<div>
		<label for="description" style="display:block;">Caption <span class="option">(optional)</span></label>
		<textarea rows="12" cols="84" name="description" id="description">{editBody}</textarea>											
	</div>

	<input type="hidden" name="title" id="title" value="" />
	<input type="hidden" name="MAX_FILE_SIZE" value="10485760" />
	<input type="hidden" name="type" id="type" value="{type}" />
	<input type="hidden" name="date" id="date" value="{date}" />
	<input type="hidden" name="id_user" id="id_user" value="{id_user}" />




	<script>
		$('#photo_upload').css('display','none');	
		$("#autosave").validate({
			rules: {				
				photo: { 
					required:  function() {
 						return ($('#photo_upload').css('display')!= 'none') ? true : false;
  					},
					accept: "(jpe?g|gif|png)" 
				},
 				url: { 
					required:  function() {
 						return ($('#photo_url').css('display')!= 'none') ? true : false;
  					},
					url: true
				}
			},
			errorElement: "span",
			errorClass: "validate_span", 
			errorPlacement: function(label, element) { 
				label.prependTo(element.prev())
			}			 
		});

		$("#photo_upload a.linkFrm").click( function() {
				$('#photo_upload').css('display','none');				
				$('#photo_url').css('display','block'); 
				$('#photo').val(''); 
				return false;
			} 
		);
		
		$("#photo_url a.linkFrm").click( function() {
				$('#photo_url').css('display','none');				
				$('#photo_upload').css('display','block'); 
				$('#url').val(''); 
				return false;
			} 
		);

	</script>